﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using posmoon.Tree;

namespace posmoon.Forms
{
    public partial class HostRegisterForm : Form
    {
        private List<HostTreeNode> _hostList;
        private HostTreeNode _newNode;

        public HostRegisterForm()
        {
            InitializeComponent();
            _hostList = new List<HostTreeNode>();
        }

        private void btnReg_Click(object sender, EventArgs e)
        {
            _newNode = new HostTreeNode(txtHostName.Text,                                                                          
                                              txtHostIP.Text,
                                              cbxDefDB.Text, 
                                              txtPort.Value.ToString(),
                                              txtUserName.Text, 
                                              txtUserPass.Text);

            _newNode.Register();
            Close();
        }

        public HostTreeNode NewNode
        {
            get { return _newNode; }
        }
    }
}
